@extends('layouts.default')

@section('content')

	<div class="panel panel-info">
        <div class="panel-heading">Liste de mes personnages</div>
        <div class="table-responsive">
            <table class="table table-striped table-hover table-char">
            	<thead>
                    <th width="10%">Classe</th>
                    <th>Nom</th>
                    <th>Niveau</th>
                    <th>Action</th>
                </thead>
                <tbody>
				@foreach($chars as $char)
					<tr>
						<td>
							<img src="{{ asset('images/class-icons/icon_emblem_' . strtolower($char->char_class) . '.png') }}"/> 
						</td>
						<td>
							{{ $char->char_name }} - {{ $char->char_type }}
						</td>
						<td>
							{{ $char->char_level }}
						</td>
						<td>
							<a href="#" class="btn btn-primary">
                                <span class="glyphicon glyphicon-edit"></span>
                                Editer
                            </a>
                            <a href="#" class="btn btn-danger">
                                <span class="glyphicon glyphicon-remove"></span>
                                Supprimer
                            </a>
						</td>
					</tr>
				@endforeach
				</tbody>
			</table>
		</div>
	</div>

	<h3> Ajouter un personnage </h3>
	{{ Form::open(array('route' => 'add-char', 'method' => 'post', 'id' => 'add-char')) }}
		{{ Form::text('charname', null, array('id' => 'charname','placeholder' => 'Nom du personnage', 'class' => 'form-control')) }}
		{{$errors->first('charname')}}
		{{ Form::text('charlevel', null, array('id' => 'charlevel','placeholder' => 'Lvl', 'class' => 'form-control', 'maxlength' => '2')) }}
		{{$errors->first('charlevel')}}
		{{ Form::select(
			'charclass', 
			array(
				'Templier' => 'Templier',
				'Gladiateur' => 'Gladiateur',
				'Assassin' => 'Assassin',
				'Rôdeur' => 'Rôdeur',
				'Sorcier' => 'Sorcier',
				'Spiritualiste' => 'Spiritualiste',
				'Clerc' => 'Clerc',
				'Aède' => 'Aède',
				'Barde' => 'Barde',
				'Pistolero' => 'Pistolero',
				'Ethertech' => 'Ethertech'
			),
			'Templier',
			array(
				'id' => 'charclass',
				'class' => 'form-control'
			)
		   ) 
		}}
		{{ Form::select(
			'chartype',
			array(
				'Principal' => 'Principal',
				'Reroll' => 'Reroll'
			),
			'Reroll',
			array(
				'id' => 'chartype',
				'class' => 'form-control'
			)
		 )
		}}
		{{ Form::submit('Ajouter le personnage', array('class' => 'btn btn-default')) }}
	{{ Form::close() }}
@stop